<script lang="ts" setup>
import type {GridItem} from "@/interfaces/grid";

interface Props {
  list:GridItem[];
  column:number;
}
const {list} = defineProps<Props>()
const click = (url:string) => {
  if (url){
    uni.$u.route({
      url
    })
  }
}
</script>

<template>
  <view class="grid-item">
    <u-grid
        :border="false"
        @click="click"
        :col="column"
    >
      <u-grid-item
          v-for="(baseListItem,baseListIndex) in list"
          :key="baseListIndex"
          @tap="click(baseListItem.url)"
      >
        <u-icon
            :customStyle="{paddingTop:20+'rpx'}"
            :name="baseListItem.name"
            :size="48"
        ></u-icon>
        <text class="grid-text">{{ baseListItem.title }}</text>
      </u-grid-item>
    </u-grid>
  </view>
</template>

<style lang="scss" scoped>

</style>